
<template>
    <div>
        <el-form :inline="true" :model="formInline" class="demo-form-inline" style="border-bottom:1px solid #ccc;">
            <!--网点编码-->
            <el-form-item :label="nowLangue.dotCode" class="selectMB10">
                <el-input size="mini" v-model="formInline.materialName" :placeholder="nowLangue.pleaseImport+nowLangue.dotCode"></el-input>
            </el-form-item>
            <!--网点名称-->
            <el-form-item :label="nowLangue.dotName" class="selectMB10">
                <el-input size="mini" v-model="formInline.materialName" :placeholder="nowLangue.pleaseImport+nowLangue.dotName"></el-input>
            </el-form-item>
            <!--借用订单号-->
            <el-form-item :label="nowLangue.lendOrderCode" class="selectMB10">
                <el-input size="mini" v-model="formInline.materialName" :placeholder="nowLangue.pleaseImport+nowLangue.lendOrderCode"></el-input>
            </el-form-item>
            <!--维修订单号-->
            <el-form-item :label="nowLangue.repairOrderCode" class="selectMB10">
                <el-input size="mini" v-model="formInline.materialName" :placeholder="nowLangue.pleaseImport+nowLangue.repairOrderCode"></el-input>
            </el-form-item>
            <!--签收时间-->
            <div class="dayChose">
                <el-form-item :label="nowLangue.signTime" class="selectMB10" >
                    <el-date-picker type="date" :editable="false" v-model="formInline.startCreateTime" clearable :placeholder="nowLangue.pleaseSelect" @change="selectedCreateTimeBegin"></el-date-picker>
                </el-form-item>
                <span v-text="nowLangue.to"></span>
                <el-form-item  class="selectMB10" style="margin-right:20px;">
                    <el-date-picker clearable :editable="false" v-model="formInline.endCreateTime"  type="date" :placeholder="nowLangue.pleaseSelect" @change="selectedCreateTimeEnd"></el-date-picker>
                </el-form-item>
            </div>
            <!--备件条码-->
            <el-form-item :label="nowLangue.spareBarCode" class="selectMB10">
                <el-input size="mini" v-model="formInline.materialName" :placeholder="nowLangue.pleaseImport+nowLangue.spareBarCode"></el-input>
            </el-form-item>
            <!-- 备件编码-->
            <el-form-item :label="nowLangue.spareCode" class="selectMB10">
                <el-input size="mini" v-model="formInline.materialName" :placeholder="nowLangue.pleaseImport+nowLangue.spareCode"></el-input>
            </el-form-item>
            <!-- 备件名称-->
            <!--<el-form-item :label="nowLangue.spareName" class="selectMB10">
                <el-input size="mini" v-model="formInline.materialName" :placeholder="nowLangue.pleaseImport+nowLangue.spareName"></el-input>
            </el-form-item>-->
            <!--状态-->
            <el-form-item :label="nowLangue.status" class="selectMB10">
                <el-select size="mini" clearable v-model="formInline.status" :placeholder="nowLangue.pleaseSelect">
                    <el-option v-for="(status,index) in statusList" :key="index" :label="status.label" :value="status.value"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item class="selectMB10">
                <el-button class="bolder outsideBtnBS selectAll" :disabled="selectDisabled" size="mini" type="danger" @click="queryClick()" v-text="nowLangue.query"></el-button>
            </el-form-item>
        </el-form>
        <!--表格-->
        <label class="default-label" v-text="nowLangue.spareLendDetail"></label>
        <el-table :data="spareLendData" border style="width: 100%;" v-loading.body="loading" :element-loading-text="nowLangue.loadDesperately">
            <el-table-column type="index" header-align="center" align="center" :label="nowLangue.sequence" width="40"></el-table-column>
            <!--操作-->
            <el-table-column :label="nowLangue.operate" header-align="center" align="center" width="80">
                <template scope="scope">
                    <!--DOA备案-->
                    <div class="operationItem bolder" @click="add" v-text="nowLangue.DOAkeep"></div>
                </template>
            </el-table-column>
            <!--备件编码-->
            <el-table-column prop="" :label="nowLangue.spareCode" header-align="center" show-overflow-tooltip></el-table-column>
            <!--备件名称-->
            <el-table-column prop="" :label="nowLangue.spareName" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--备件条码-->
            <el-table-column prop="" :label="nowLangue.spareBarCode" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--借用订单号-->
            <el-table-column prop="" :label="nowLangue.lendOrderCode" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--维修订单号-->
            <el-table-column prop="" :label="nowLangue.repairOrderCode" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--签收时间-->
            <el-table-column prop="" :label="nowLangue.signTime" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--状态-->
            <el-table-column prop="" :label="nowLangue.status" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--备件小类-->
            <el-table-column prop="" :label="nowLangue.spareClass" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--计划大类-->
            <el-table-column prop="" :label="nowLangue.planClass" header-align="center" show-overflow-tooltip></el-table-column>
            <!--产品线-->
            <el-table-column prop="" :label="nowLangue.productLine" header-align="center" show-overflow-tooltip></el-table-column>
        </el-table>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                nowLangue:{},
                languageScoped:{
                    zh:{
                        "pleaseSelect":"请选择",
                        "pleaseImport":"请输入",
                        "spareCode":"备件编码",
                        "spareName":"备件名称",
                        "spareBarCode":"备件条码",
                        "to":"至",
                        "query":"查询",
                        "loadDesperately":"拼命加载中",
                        "sequence":"序",
                        "operate":"操作",
                        "status":"状态",
                        "signTime":"签收时间",
                        "dotCode":"网点编码",
                        "dotName":"网点名称",
                        "lendOrderCode":"借用订单号",
                        "repairOrderCode":"维修订单号",
                        "spareLendDetail":"备件借用明细",
                        "DOAkeep":"DOA备案",
                        "planClass":"计划大类",
                        "productLine":"产品线",
                        "spareClass":"备件小类",
                        "addSpareDOA":"新建备件DOA",
                        "DOAcode":"DOA备案号",
                        "recorder":"备案人员",
                        "recordTime":"备案时间",
                        "repairDotName":"维修网点名称",
                        "repairCode":"维修单号",
                        "hostModel":"主机型号",
                        "lendCode":"借用单号",
                        "DOAtype":"DOA类型",
                        "faultCode":"故障编码",
                        "faultName":"故障名称",
                        "conditionDescribe":"情况说明",
                        "saveAndSubmit":"保存并提交",
                        "save":"保存",
                        "cancel":"取消",
                        "DOAretest":"DOA复测步骤",
                        "stepTitle":"步骤标题",
                        "stepDescribe":"步骤说明",
                        "retestResult":"复测结果",
                        "retestDescribe":"复测说明",
                        "DOAappearImage":"DOA外观图片",
                        "imageName":"图片名称",
                        "delete":"删除",
                        "uploadImage":"上传图片"
                    },
                    en:{
                        "pleaseSelect":"pleaseSelect",
                        "pleaseImport":"pleaseImport",
                        "spareCode":"spareCode",
                        "spareName":"spareName",
                        "to":"to",
                        "query":"query",
                        "loadDesperately":"loadDesperately",
                        "sequence":"sequence",
                        "operate":"operate",
                        "status":"status",
                        "signTime":"signTime",
                        "dotCode":"dotCode",
                        "dotName":"dotName",
                        "lendOrderCode":"lendOrderCode",
                        "repairOrderCode":"repairOrderCode",
                        "spareLendDetail":"spareLendDetail",
                        "DOAkeep":"DOAkeep",
                        "planClass":"planClass",
                        "productLine":"productLine",
                        "spareClass":"spareClass",
                        "addSpareDOA":"addSpareDOA",
                        "DOAcode":"DOAcode",
                        "recorder":"recorder",
                        "recordTime":"recordTime",
                        "repairDotName":"repairDotName",
                        "repairCode":"repairCode",
                        "hostModel":"hostModel",
                        "lendCode":"lendCode",
                        "DOAtype":"DOAtype",
                        "faultCode":"faultCode",
                        "faultName":"faultName",
                        "conditionDescribe":"conditionDescribe",
                        "saveAndSubmit":"saveAndSubmit",
                        "save":"save",
                        "cancel":"cancel",
                        "DOAretest":"DOAretest",
                        "stepTitle":"stepTitle",
                        "stepDescribe":"stepDescribe",
                        "retestResult":"retestResult",
                        "retestDescribe":"retestDescribe",
                        "DOAappearImage":"DOAappearImage",
                        "imageName":"imageName",
                        "delete":"delete",
                        "uploadImage":"uploadImage"
                    }
                },
                // 查询表单
                formInline:{

                },
                spareLendData:[{
                    name:"aaa"
                }],
                //查询禁用
                selectDisabled:false,
                loading:false,
            };
        },
        created:function(){
            this.languageType=="zh"?this.nowLangue=this.languageScoped.zh:this.nowLangue=this.languageScoped.en;
        },
        computed:{
            languageType(){
                return this.$store.state.languageType;
            }
        },
        watch:{
            languageType(){
                this.languageType=="zh"?this.nowLangue=this.languageScoped.zh:this.nowLangue=this.languageScoped.en;
            }
        },
        //进入页面立即运行此方法
        mounted: function () {
            var _this = this;
            _this.$store.commit('currentActive', 'SpareDOA');
        },
        methods:{
            // 选择创建开始日期
            selectedCreateTimeBegin(val){

            },
            // 选择创建结束日期
            selectedCreateTimeEnd(val){

            },
            //查询列表
            queryClick(){
                /*var _this=this;
                 _this.loading=true;
                 var urlAddress="";
                 if(this.isClickBySelect){
                     urlAddress="projectSubstitute/queryMaterialByPage";
                 }else{
                     urlAddress="projectSubstitute/queryIncreasementMaterialByPage";
                 }
                 var tmp={
                     productLineId:_this.formInline.productLineId,
                     legalPersonCode:_this.formInline.legalPersonCode,
                     startCreateTime:_this.formInline.startCreateTime,
                     endCreateTime:_this.formInline.endCreateTime,
                     materialCode:_this.formInline.materialCode,
                     materialName:_this.formInline.materialName,
                     status:_this.formInline.status,
                     pageIndex:_this.pageIndex,
                     pageSize:_this.pageSize
                 };
                 $.ajax({
                     type: 'POST',
                     url: _this.metadata_service+urlAddress,
                     cache: false,
                     data:JSON.stringify(tmp),
                     dataType:'JSON',
                     contentType: "application/json;charset=utf-8",
                     success: function (data) {
                         if (data.success) {
                             _this.loading=false;
                             _this.isPaging=true;
                             _this.totalPage=data.data.totalPage;
                             _this.totalNumber=data.data.totalNumber;
                             _this.productData=data.data.dataList;
                         }else{
                             _this.loading=false;
                            _this.common.errorTip(data.errorMessage)
                         }
                     }
                 });*/
            },
            add(){
                this.$router.push({ path: 'CreateSpareDOA'})
            },
        }
    }
</script>



